package com.acme.superchat.service.exception;

/**
 * @author Alexander Kotov (kotov.alex.22@gmail.com)
 */
public class NickExistsException extends Exception {
    private final String name;

    public NickExistsException(String name) {
        this.name = name;
    }

    public NickExistsException(String message, String name) {
        super(message);
        this.name = name;
    }

    public NickExistsException(String message, Throwable cause, String name) {
        super(message, cause);
        this.name = name;
    }

    public NickExistsException(Throwable cause, String name) {
        super(cause);
        this.name = name;
    }

    @Override
    public String getMessage() {
        return "Client with nick " + name + " already exists";
    }
}
